const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
  productionSourceMap: false,
  transpileDependencies: true,
  // 关闭esline
  lintOnSave: false,
  // 代理跨越
  devServer: {
    proxy: {
      "/api": {
        target: "http://123.207.90.216:8012",
        pathRewrite: {
          "^/api": "",
        },
      },
    },
  },
  // vue.config.js
  configureWebpack: {
    resolve: {
      fallback: {
        path: require.resolve("path-browserify"),
      },
    },
  },

  chainWebpack: (config) => {
    // twig rule loader
    const twigRule = config.module.rule("twig");
    twigRule.exclude.add(/node_modules/);
    // 添加新的loader处理
    twigRule
      .test(/\.twig$/)
      .use("twig-loader")
      .loader("twig-loader")
      .end();
  },
});
